home *** CD-ROM | disk | FTP | other *** search
/ You're the Director / You're The Director.iso / pc / macf / mspa.dir / 00001.ls next >
Encoding:
Text File  |  1995-10-10  |  16.2 KB  |  676 lines

  1. on startMovie
  2.   global max, movielist, limit, splist, reset, letgo, gSound, prev, gCurrentSprite, CurrentAudio, fullscreenG, gRewind, gSpeed, LastButton
  3.   set the preLoadEventAbort to 1
  4.   initsel()
  5.   openXLib("QT.X")
  6.   set LastButton to 0
  7.   set fullscreenG to 0
  8.   set gRewind to 0
  9.   set gSpeed to 1
  10.   set CurrentAudio to 100
  11.   set CurrentAudio to string(CurrentAudio)
  12.   set magcursor to [the number of cast "Clapboard"]
  13.   set the cursor of sprite 1 to magcursor
  14.   set gCurrentSprite to 3
  15.   set prev to 0
  16.   set gSound to 6
  17.   set prev to 0
  18.   set letgo to 0
  19.   set reset to 0
  20.   set the visible of sprite 19 to 0
  21.   set the textSize of field "movie" to 24
  22.   set the textSize of field "name" to 24
  23.   repeat with i = 21 to 45
  24.     puppetSprite(i, 1)
  25.   end repeat
  26.   set the visible of sprite 45 to 0
  27.   initsel()
  28.   set splist to [[195, 211], [195, 294], [195, 377], [443, 211], [443, 294], [443, 377]]
  29.   set limit to 24
  30.   set movielist to []
  31.   hidebar()
  32.   set max to count(movielist)
  33.   when keyDown then globalkey
  34.   repeat with x = 46 to 48
  35.     puppetSprite(x, 1)
  36.     set the visible of sprite x to 0
  37.     puppetSprite(x, 0)
  38.   end repeat
  39.   go("Options")
  40.   updateStage()
  41. end
  42.  
  43. on idle
  44.   preLoadCast()
  45. end
  46.  
  47. on testbut
  48.   global movielist
  49.   if count(movielist) <= 0 then
  50.     repeat with i = 12 to 18
  51.       set the visible of sprite i to 0
  52.     end repeat
  53.   else
  54.     repeat with i = 12 to 18
  55.       set the visible of sprite i to 1
  56.     end repeat
  57.   end if
  58. end
  59.  
  60. on setdef
  61.   repeat with i = 12 to 18
  62.     set the visible of sprite i to 1
  63.   end repeat
  64. end
  65.  
  66. on addbar x
  67.   global letgo, movielist
  68.   if count(movielist) >= 24 then
  69.     exit
  70.   end if
  71.   set letgo to 0
  72.   set yu to string(item 1 of the name of cast the number of cast string(chars(the name of cast the castNum of sprite x, 1, 2) & "s"))
  73.   reset()
  74.   add(movielist, yu)
  75.   set max to count(movielist)
  76.   setbar()
  77. end
  78.  
  79. on addbarC x
  80.   global letgo, movielist
  81.   if count(movielist) >= 24 then
  82.     exit
  83.   end if
  84.   set letgo to 0
  85.   set vu to the number of cast string(chars(the name of cast the castNum of sprite x, 1, 2) & "s")
  86.   set yu to string(item 1 of the name of cast vu)
  87.   add(movielist, yu)
  88.   set max to count(movielist)
  89.   set the castNum of sprite (20 + max) to vu
  90.   updateStage()
  91.   showbar()
  92.   reset()
  93. end
  94.  
  95. on showbar
  96.   global movielist, max, limit
  97.   set the visible of sprite 2 to 1
  98.   repeat with i = 21 to 20 + count(movielist)
  99.     set the visible of sprite i to 1
  100.   end repeat
  101.   repeat with i = 20 + count(movielist) + 1 to 20 + limit
  102.     set the visible of sprite i to 0
  103.   end repeat
  104.   updateStage()
  105. end
  106.  
  107. on hidebar
  108.   global movielist, max, limit
  109.   if the frame > 18 then
  110.     set the visible of sprite 2 to 0
  111.   end if
  112.   repeat with i = 21 to 20 + limit
  113.     set the visible of sprite i to 0
  114.   end repeat
  115.   updateStage()
  116. end
  117.  
  118. on setbar
  119.   global movielist, max, selected, limit, fullscreenG
  120.   if count(movielist) = 0 then
  121.     repeat with i = 21 to 20 + limit
  122.       set the visible of sprite i to 0
  123.     end repeat
  124.     exit
  125.   end if
  126.   repeat with i = 1 to count(movielist)
  127.     set the castNum of sprite (20 + i) to the number of cast string(getAt(movielist, i))
  128.   end repeat
  129.   repeat with i = 1 to count(selected)
  130.     if getAt(selected, i) = 1 then
  131.       if fullscreenG = 0 then
  132.         set the ink of sprite (20 + i) to 4
  133.         puppetSprite(45, 1)
  134.         set the moveableSprite of sprite 45 to 1
  135.         set newsprite to 20 + i
  136.         set the locH of sprite 45 to the locH of sprite newsprite
  137.         set the locV of sprite 45 to the locV of sprite newsprite
  138.         set the ink of sprite 45 to 36
  139.         set the visible of sprite 45 to 1
  140.         set the moveableSprite of sprite 45 to 0
  141.         updateStage()
  142.       end if
  143.       next repeat
  144.     end if
  145.     set the ink of sprite (20 + i) to 0
  146.     updateStage()
  147.   end repeat
  148.   if fullscreenG = 0 then
  149.     showbar()
  150.   end if
  151. end
  152.  
  153. on namesmall
  154.   set x1 to 100
  155.   repeat with i = 1 to 36
  156.     set yur to numToChar(charToNum("`") + (i / 6) + 1)
  157.     set the name of cast (i + x1) to string(yur & i mod 6) & "s"
  158.     if (i mod 6) = 0 then
  159.       set the name of cast (i + x1) to string(numToChar(charToNum(yur) - 1) & "6") & "s"
  160.     end if
  161.   end repeat
  162. end
  163.  
  164. on namemov
  165.   set x1 to 136
  166.   repeat with i = 1 to 36
  167.     set yur to numToChar(charToNum("`") + (i / 6) + 1)
  168.     set the name of cast (i + x1) to string(yur & i mod 6) & ".mov"
  169.     if (i mod 6) = 0 then
  170.       set the name of cast (i + x1) to string(numToChar(charToNum(yur) - 1) & "6") & ".mov"
  171.     end if
  172.   end repeat
  173. end
  174.  
  175. on initsp
  176.   global splist
  177.   set splist to []
  178.   set x to 3
  179.   repeat with i = x to x + 5
  180.     add(splist, [the locH of sprite i, the locV of sprite i])
  181.   end repeat
  182. end
  183.  
  184. on reset
  185.   global splist, reset
  186.   if the frame = 56 then
  187.     exit
  188.   end if
  189.   set x to 13
  190.   repeat with i = x to x + 5
  191.     set yu to getAt(splist, i - x + 1)
  192.     set the locH of sprite i to getAt(yu, 1)
  193.     set the locV of sprite i to getAt(yu, 2)
  194.     set the castNum of sprite i to the number of cast string(chars(the name of cast the castNum of sprite i, 1, 2))
  195.     set the ink of sprite i to 0
  196.     updateStage()
  197.   end repeat
  198.   updateStage()
  199. end
  200.  
  201. on playmovn
  202.   set yu to the clickOn
  203.   puppetSprite(48, 1)
  204.   set the castNum of sprite 48 to the number of cast string(chars(the name of cast the castNum of sprite yu, 1, 2) & ".MOV")
  205.   set the visible of sprite 48 to 1
  206.   set the movieTime of sprite 48 to 0
  207.   set the movieRate of sprite 48 to 1
  208.   set the controller of cast the castNum of sprite 48 to 0
  209.   repeat while (the movieTime of sprite 48 < the duration of cast the castNum of sprite 48) and the controlDown
  210.     updateStage()
  211.   end repeat
  212.   set the movieTime of sprite 48 to 0
  213.   set the movieRate of sprite 48 to 0
  214.   set the visible of sprite 48 to 0
  215. end
  216.  
  217. on playmovn2
  218.   set yu to the clickOn
  219.   puppetSprite(48, 1)
  220.   set yu to 0
  221.   repeat with i = 1 to count(movielist)
  222.     if getAt(selected, i) = 1 then
  223.       set yu to i
  224.     end if
  225.     if yu <> 0 then
  226.       exit repeat
  227.     end if
  228.   end repeat
  229.   if yu = 0 then
  230.     exit
  231.   end if
  232.   set yu to yu + 20
  233.   set the castNum of sprite 48 to the number of cast string(chars(the name of cast the castNum of sprite yu, 1, 2) & ".MOV")
  234.   set the visible of sprite 48 to 1
  235.   set the controller of cast the castNum of sprite 48 to 1
  236.   updateStage()
  237.   set the movieTime of sprite 48 to 0
  238.   set the movieRate of sprite 48 to 1
  239.   updateStage()
  240.   repeat while (the movieTime of sprite 48 < the duration of cast the castNum of sprite 48) and not (the controlDown)
  241.     updateStage()
  242.   end repeat
  243.   set the movieTime of sprite 48 to 0
  244.   set the movieRate of sprite 48 to 0
  245.   set the visible of sprite 48 to 0
  246.   updateStage()
  247.   repeat with x = 13 to 18
  248.     set the visible of sprite x to 1
  249.   end repeat
  250.   updateStage()
  251. end
  252.  
  253. on playmovn3
  254.   global prev
  255.   if prev = 1 then
  256.     set yu to the clickOn
  257.     puppetSprite(48, 1)
  258.     set yu to 0
  259.     repeat with i = 1 to count(movielist)
  260.       if getAt(selected, i) = 1 then
  261.         set yu to i
  262.         set the visible of sprite 19 to 1
  263.         repeat with x = 13 to 18
  264.           set the visible of sprite x to 0
  265.         end repeat
  266.         puppetSound(0)
  267.         updateStage()
  268.       end if
  269.       if yu <> 0 then
  270.         exit repeat
  271.       end if
  272.     end repeat
  273.     if yu = 0 then
  274.       set prev to 0
  275.       exit
  276.     end if
  277.     set yu to yu + 20
  278.     set the castNum of sprite 48 to the number of cast string(chars(the name of cast the castNum of sprite yu, 1, 2) & ".MOV")
  279.     set the visible of sprite 48 to 1
  280.     set the controller of cast the castNum of sprite 48 to 1
  281.     updateStage()
  282.     set the movieTime of sprite 48 to 0
  283.     set the movieRate of sprite 48 to 1
  284.     updateStage()
  285.     set prev to 2
  286.   end if
  287.   if (the movieTime of sprite 48 < the duration of cast the castNum of sprite 48) and not (the controlDown) then
  288.     updateStage()
  289.   else
  290.     set prev to 0
  291.     set the movieTime of sprite 48 to 0
  292.     set the movieRate of sprite 48 to 0
  293.     set the visible of sprite 48 to 0
  294.     updateStage()
  295.     set the visible of sprite 19 to 0
  296.     repeat with x = 13 to 18
  297.       set the visible of sprite x to 1
  298.     end repeat
  299.     puppetSound("OPEN.AIF")
  300.     updateStage()
  301.   end if
  302. end
  303.  
  304. on playmovn3Q
  305.   global prev, Clips, Current
  306.   if prev = 1 then
  307.     set yu to the clickOn
  308.     set yu to 0
  309.     repeat with i = 1 to count(movielist)
  310.       if getAt(selected, i) = 1 then
  311.         set yu to i
  312.         set the visible of sprite 19 to 1
  313.         puppetSound(0)
  314.         updateStage()
  315.       end if
  316.       if yu <> 0 then
  317.         exit repeat
  318.       end if
  319.     end repeat
  320.     if yu = 0 then
  321.       set prev to 0
  322.       exit
  323.     end if
  324.     set yu to yu + 20
  325.     set Clips to the fileName of cast string(chars(the name of cast the castNum of sprite yu, 1, 2) & ".MOV")
  326.     set prev to 2
  327.     set Current to 0
  328.     playQTF(Clips, "160,140", 0)
  329.     updateStage()
  330.   else
  331.     set prev to 0
  332.     updateStage()
  333.     set the visible of sprite 19 to 0
  334.     repeat with x = 13 to 18
  335.       set the visible of sprite x to 1
  336.     end repeat
  337.     repeat with x = 3 to 7
  338.       puppetSprite(x, 1)
  339.       set the visible of sprite x to 1
  340.       puppetSprite(x, 0)
  341.     end repeat
  342.     set MovieSeq to 0
  343.     setbar()
  344.     puppetSound("OPEN.AIF")
  345.     updateStage()
  346.   end if
  347. end
  348.  
  349. on playmovn4Q yu
  350.   global k, mm, Current, prev, Clips
  351.   set yu to yu + 20
  352.   set i to chars(the name of cast the castNum of sprite yu, 1, 3)
  353.   set place to getOne(movielist, i)
  354.   set k to place
  355.   set mm to place
  356.   set Clips to the fileName of cast string(chars(the name of cast the castNum of sprite yu, 1, 2) & ".MOV")
  357.   set prev to 2
  358.   set Current to 1
  359.   playQTF(Clips, "160,140", 0)
  360. end
  361.  
  362. on playmovn4 yu
  363.   global k, mm
  364.   set yu to yu + 20
  365.   set i to chars(the name of cast the castNum of sprite yu, 1, 3)
  366.   set place to getOne(movielist, i)
  367.   set k to place
  368.   set mm to place
  369.   set the castNum of sprite 48 to the number of cast string(chars(the name of cast the castNum of sprite yu, 1, 2) & ".MOV")
  370.   set the visible of sprite 48 to 1
  371.   set the controller of cast the castNum of sprite 48 to 1
  372.   updateStage()
  373.   set the movieTime of sprite 48 to 0
  374.   set the movieRate of sprite 48 to 1
  375.   updateStage()
  376. end
  377.  
  378. on initsel
  379.   global selected
  380.   set selected to [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0]
  381. end
  382.  
  383. on delset
  384.   global selected, movielist
  385.   if count(movielist) <= 0 then
  386.     exit
  387.   end if
  388.   set sel to countsel()
  389.   if sel = 0 then
  390.     exit
  391.   end if
  392.   set del to []
  393.   repeat with i = 1 to count(movielist)
  394.     if getAt(selected, i) = 1 then
  395.       setAt(movielist, i, 0)
  396.     end if
  397.   end repeat
  398.   put del
  399.   set mv2 to []
  400.   repeat with i in movielist
  401.     if i <> 0 then
  402.       add(mv2, i)
  403.     end if
  404.   end repeat
  405.   set movielist to mv2
  406.   set the visible of sprite 45 to 0
  407.   updateStage()
  408.   initsel()
  409.   setbar()
  410. end
  411.  
  412. on plusset
  413.   global selected, movielist
  414.   if count(movielist) <= 0 then
  415.     exit
  416.   end if
  417.   set sel to countsel()
  418.   if (sel = count(movielist)) or (sel = 0) then
  419.     exit
  420.   end if
  421.   initsel()
  422.   setAt(selected, sel, 1)
  423.   repeat with i = count(movielist) - 1 down to 1
  424.     if getAt(selected, i) = 1 then
  425.       set yut to getAt(movielist, i)
  426.       setAt(movielist, i, getAt(movielist, i + 1))
  427.       setAt(movielist, i + 1, yut)
  428.       deleteAt(selected, count(selected))
  429.       addAt(selected, 1, 0)
  430.       exit repeat
  431.     end if
  432.   end repeat
  433.   setbar()
  434. end
  435.  
  436. on minset
  437.   global selected, movielist
  438.   if count(movielist) <= 0 then
  439.     exit
  440.   end if
  441.   if getAt(selected, 1) = 1 then
  442.     exit
  443.   end if
  444.   set sel to countsel()
  445.   if sel = 0 then
  446.     exit
  447.   end if
  448.   initsel()
  449.   setAt(selected, sel, 1)
  450.   repeat with i = 1 to count(movielist)
  451.     if getAt(selected, i) = 1 then
  452.       set yut to getAt(movielist, i)
  453.       deleteAt(movielist, i)
  454.       add(movielist, i - 1, yut)
  455.       deleteAt(selected, 1)
  456.       add(selected, 0)
  457.       exit repeat
  458.     end if
  459.   end repeat
  460.   setbar()
  461. end
  462.  
  463. on countsel
  464.   repeat with i = 1 to count(selected)
  465.     if getAt(selected, i) = 1 then
  466.       return i
  467.       exit
  468.     end if
  469.   end repeat
  470.   return 0
  471. end
  472.  
  473. on clearall
  474.   global movielist
  475.   set movielist to []
  476.   set the visible of sprite 45 to 0
  477.   initsel()
  478.   setbar()
  479. end
  480.  
  481. on globalkey
  482.   if the key = BACKSPACE then
  483.     delset()
  484.   end if
  485.   if the key = "+" then
  486.     plusset()
  487.   end if
  488.   if the key = "-" then
  489.     minset()
  490.   end if
  491. end
  492.  
  493. on compilemov
  494.   global movielist, comp, k, mm
  495.   if k = 0 then
  496.     puppetSprite(48, 1)
  497.     set k to 0
  498.     set mm to 1
  499.   end if
  500.   if k <> mm then
  501.     set k to mm
  502.     if k <= count(movielist) then
  503.       set i to getAt(movielist, k)
  504.       initsel()
  505.       setAt(selected, k, 1)
  506.       setbar()
  507.       set j to chars(i, 1, 2)
  508.       set the castNum of sprite 48 to the number of cast (j & ".mov")
  509.       set the directToStage of cast the castNum of sprite 48 to 1
  510.       set the visible of sprite 48 to 1
  511.       set the controller of cast the castNum of sprite 48 to 1
  512.       updateStage()
  513.       set the movieTime of sprite 48 to 0
  514.       set the movieRate of sprite 48 to 1
  515.       updateStage()
  516.     else
  517.       set the visible of sprite 48 to 0
  518.       puppetSprite(48, 0)
  519.       set comp to 0
  520.       set k to 0
  521.       go("EndMovie")
  522.     end if
  523.   end if
  524.   if the movieTime of sprite 48 < the duration of cast the castNum of sprite 48 then
  525.     updateStage()
  526.   else
  527.     set the movieRate of sprite 48 to 0
  528.     set mm to mm + 1
  529.   end if
  530. end
  531.  
  532. on compilemovQ
  533.   global movielist, comp, k, mm, prev, Clips, Current, fullscreenG, gSpeed, MovieSeq
  534.   if k = 0 then
  535.     set k to 0
  536.     set mm to 1
  537.   end if
  538.   if k <> mm then
  539.     set k to mm
  540.     if k <= count(movielist) then
  541.       set i to getAt(movielist, k)
  542.       initsel()
  543.       setAt(selected, k, 1)
  544.       if fullscreenG = 0 then
  545.         setbar()
  546.       end if
  547.       set j to chars(i, 1, 2)
  548.       set prev to 2
  549.       set Clips to the fileName of cast (j & ".mov")
  550.       set Current to 1
  551.       set MovieSeq to 1
  552.       if fullscreenG = 0 then
  553.         playQTF(Clips, "160,140", 0)
  554.       else
  555.         playQTF(Clips, "0,0", 1)
  556.       end if
  557.       set mm to mm + 1
  558.       updateStage()
  559.     else
  560.       set comp to 0
  561.       set k to 0
  562.       if fullscreenG = 1 then
  563.         setbarB()
  564.         puppetSprite(48, 1)
  565.         set the visible of sprite 48 to 0
  566.         puppetSprite(48, 0)
  567.         ChangeScreenSize(Clips, "160,140", 1)
  568.       end if
  569.       stopQT()
  570.       go("EndMovie")
  571.     end if
  572.   end if
  573. end
  574.  
  575. on quitmov
  576.   global comp, k, m
  577.   set comp to 0
  578.   set k to 0
  579. end
  580.  
  581. on RunOff
  582.   global gCurrentSprite
  583.   set the editableText of sprite gCurrentSprite to 0
  584.   if gCurrentSprite = 3 then
  585.     set gCurrentSprite to 4
  586.     updateStage()
  587.   else
  588.     set gCurrentSprite to 3
  589.     testbut()
  590.     setdef()
  591.     go("no")
  592.     showbar()
  593.   end if
  594. end
  595.  
  596. on stopMovie
  597.   closeXLib()
  598. end
  599.  
  600. on beginMyMovie
  601.   global myWindow
  602.   if objectp(myWindow) then
  603.     forget(myWindow)
  604.   end if
  605.   set horzOrigin to the stageLeft
  606.   set vertOrigin to the stageTop
  607.   set myWindowRect to rect(horzOrigin, vertOrigin, horzOrigin + 640, vertOrigin + 480)
  608.   set myWindow to window "HelpMovie"
  609.   set the fileName of myWindow to "HELP.DIR"
  610.   set the titleVisible of myWindow to 0
  611.   open(myWindow)
  612.   tell window "HelpMovie"
  613.     go("Sstart")
  614.   end tell
  615. end
  616.  
  617. on finishMovie
  618.   global myWindow
  619.   if objectp(myWindow) then
  620.     forget(myWindow)
  621.   end if
  622. end
  623.  
  624. on MovieOver
  625.   global myWindow
  626.   set myWindow to window "HelpMovie"
  627.   set the fileName of myWindow to "HELP.DIR"
  628.   close(myWindow)
  629.   forget(myWindow)
  630. end
  631.  
  632. on showbarB
  633.   global movielist, max, limit
  634.   set the visible of sprite 2 to 1
  635.   repeat with i = 21 to 20 + count(movielist)
  636.     set the visible of sprite i to 1
  637.   end repeat
  638.   repeat with i = 20 + count(movielist) + 1 to 20 + limit
  639.     set the visible of sprite i to 0
  640.   end repeat
  641. end
  642.  
  643. on setbarB
  644.   global movielist, max, selected, limit, Double
  645.   put "inside setbar"
  646.   if count(movielist) = 0 then
  647.     repeat with i = 21 to 20 + limit
  648.       set the visible of sprite i to 0
  649.     end repeat
  650.     exit
  651.   end if
  652.   repeat with i = 1 to count(movielist)
  653.     set the castNum of sprite (20 + i) to the number of cast string(getAt(movielist, i))
  654.   end repeat
  655.   repeat with i = 1 to count(selected)
  656.     if getAt(selected, i) = 1 then
  657.       if Double = 0 then
  658.         set the ink of sprite (20 + i) to 4
  659.         put "above puppetSprite 45 is true"
  660.         puppetSprite(45, 1)
  661.         set the moveableSprite of sprite 45 to 1
  662.         set newsprite to 20 + i
  663.         set the locH of sprite 45 to the locH of sprite newsprite
  664.         set the locV of sprite 45 to the locV of sprite newsprite
  665.         set the visible of sprite 45 to 1
  666.         set the moveableSprite of sprite 45 to 0
  667.       end if
  668.       next repeat
  669.     end if
  670.     set the ink of sprite (20 + i) to 0
  671.   end repeat
  672.   if Double = 0 then
  673.     showbarB()
  674.   end if
  675. end
  676.